var integQueryCtrl  = new XFApp.client();
$.views.converters({
	
});

XFApp.client.prototype.integQuery = {
		successCode : 10000,	
		integQueryPage : null,
		urlItems : {
			queryListURL: basePath+"/query/list",
		},
		
		event : function (){			
			_this = this;
			$("#queryBtn").on("click",function(){
				_this.load();
			});
		},	
		
		load : function (){		
			
			dictionary = {
					dictCode : $("#dictCode").val(),
					dictName : $("#dictName").val(),
					systemDictName : $("#systemDictName").val(),
					dictType:$("#hiddenType").val(),
    		};
			if(!!_this.integQueryPage){
				_this.integQueryPage.page("remote",0,dictionary);
			}else{
				_this.integQueryPage = $("#page").page({
				pageSize : 10,
				remote: {
					url: _this.urlItems.queryListURL,
			        params: dictionary, 
			        success: function (data, pageIndex) {
			        	if(data.code==_this.successCode){
			        		if(null == data.result 
										|| null == data.result.itemList
											|| data.result.itemList.length < 1){
			        			$("#page_grid").html('<tr><td align="center" colspan="15">暂无数据</td></tr>');
			        		}else{
			        			$("#page_grid").html($("#pageTmp").render(data.result.itemList));
			        		}
			        		
			        	}else{
			        		  window.webDialogUtil.alert("提示",data.msg);
			        	}
			        },
			        error : function(){
			        	window.webDialogUtil.alert("提示",data.msg);
			        }
				},
				firstBtnText : '首页',
				lastBtnText : '尾页',
				prevBtnText : '上一页',
				nextBtnText : '下一页',
				showInfo : true,
				showJump : true,
				jumpBtnText : '跳转',
				showPageSizes : true,
				infoFormat : '共{pageCount}页'
			});	
		   }			
		},
},

$(function(){	
	integQueryCtrl.integQuery.event();
	integQueryCtrl.integQuery.load();
});